home *** CD-ROM | disk | FTP | other *** search
Text File | 1997-07-20 | 794 b | 46 lines | [TEXT/CWIE] |
- //Copyright (c) 1997 Aidan Cully
- //All rights reserved
-
- #include "ScrollTextBox.h"
- #include "CLNullHandler.h"
-
- TScrollStyleBox::TScrollStyleBox(
- TLayoutBranch *super,
- short resID
- ):
- TStyleBox( super, resID ),
- mTime( 0 ),
- mDelay( 20 )
- {
- }
-
- TScrollStyleBox::~TScrollStyleBox()
- {
- TNullHandler::GetNullHandler()->RemovePulsar( this );
- }
-
- void TScrollStyleBox::Pulse(
- const TEvent *ev
- )
- {
- if( mDelay )
- mDelay--;
- else {
- if( mPos.v+mHeight<0 )
- ScrollTo( 0, mContentRect.bottom-mContentRect.top );
- else
- ScrollTo( 0, mPos.v-1 );
- if( !mPos.v )
- mDelay= 20;
- }
- }
-
- void TScrollStyleBox::AttachedToWindow(
- TBaseWindow *win,
- Rect size
- )
- {
- TStyleBox::AttachedToWindow( win, size );
- TNullHandler::GetNullHandler()->AddPulsar( this );
- ::TESetJust( teJustCenter, mTE );
- }